import React from 'react'
import { Table, Space } from 'antd'

const MonitorList = props => {

    const data = [
        {
            key: '1',
            name: '服务一',
            status: '运行中',
            aliveTime: '1d5h'
        },
        {
            key: '2',
            name: '服务二',
            status: '运行中',
            aliveTime: '10h'
        },
        {
            key: '3',
            name: '服务三',
            status: '运行中',
            aliveTime: '30d5h'
        },
        {
            key: '4',
            name: '服务四',
            status: '停止运行',
            aliveTime: '40d5h'
        },
        {
            key: '5',
            name: '服务五',
            status: '运行失败',
            aliveTime: '5h'
        }
    ]

    const columns = [
        {
            title: '服务名',
            dataIndex: 'name',
            key: 'name'
          },
          {
            title: '存活时间',
            dataIndex: 'aliveTime',
            key: 'aliveTime',
          },
          {
            title: '状态',
            dataIndex: 'status',
            key: 'status'
          },
          {
            title: '操作',
            key: 'action',
            render: (text, record) => (
              <Space size="middle">
                <a>重启</a>
                <a>停止</a>
              </Space>
            )
          },
    ]

    return (
        <div style={{padding: "10px"}}>
            <Table columns={columns} dataSource={data} />
        </div>
    )
}

export default MonitorList